﻿using System.ComponentModel;
using System.Windows;
using Brjnk.Common;

namespace Brjnk.GpxExplorer.UI
{
    /// <summary>
    /// Interaction logic for BitmapExportPaperWindow.xaml
    /// </summary>
    public partial class BitmapExportPaperWindow : Window, INotifyPropertyChanged
    {
        public BitmapExportPaperWindow()
        {
            InitializeComponent();
            this.DataContext = this;
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            SelectedPaper = paperPicker.SelectedPaper;
            this.DialogResult = true;
        }

        private bool useActualSize = true;

        public bool UseActualSize
        {
            get { return useActualSize; }
            set { useActualSize = value; OnPropertyChanged("UseActualSize"); }
        }

        private PaperSize selectedPaper;

        public PaperSize SelectedPaper
        {
            get { return selectedPaper; }
            set { selectedPaper = value; OnPropertyChanged("SelectedPaper"); }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        private void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}